<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    889. Buddy Strings
   </h1>
   <p>
    Given two strings
    <code>
     A
    </code>
    and
    <code>
     B
    </code>
    &nbsp;of lowercase letters, return
    <code>
     true
    </code>
    if and only if we&nbsp;can swap two letters in
    <code>
     A
    </code>
    so that the result equals
    <code>
     B
    </code>
    .
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     Example 1:
    </strong>
   </p>
   <div>
    <pre>
<strong>Input: </strong>A = <span id="example-input-1-1">"ab"</span>, B = <span id="example-input-1-2">"ba"</span>
<strong>Output: </strong><span id="example-output-1">true</span>
</pre>
    <div>
     <p>
      <strong>
       Example 2:
      </strong>
     </p>
     <pre>
<strong>Input: </strong>A = <span id="example-input-2-1">"ab"</span>, B = <span id="example-input-2-2">"ab"</span>
<strong>Output: </strong><span id="example-output-2">false</span>
</pre>
     <div>
      <p>
       <strong>
        Example 3:
       </strong>
      </p>
      <pre>
<strong>Input: </strong>A = <span id="example-input-3-1">"aa"</span>, B = <span id="example-input-3-2">"aa"</span>
<strong>Output: </strong><span id="example-output-3">true</span>
</pre>
      <div>
       <p>
        <strong>
         Example 4:
        </strong>
       </p>
       <pre>
<strong>Input: </strong>A = <span id="example-input-4-1">"aaaaaaabc"</span>, B = <span id="example-input-4-2">"aaaaaaacb"</span>
<strong>Output: </strong><span id="example-output-4">true</span>
</pre>
       <div>
        <p>
         <strong>
          Example 5:
         </strong>
        </p>
        <pre>
<strong>Input: </strong>A = <span id="example-input-5-1">""</span>, B = <span id="example-input-5-2">"aa"</span>
<strong>Output: </strong><span id="example-output-5">false</span>
</pre>
        <p>
         &nbsp;
        </p>
        <p>
         <strong>
          <span>
           Note:
          </span>
         </strong>
        </p>
        <ol>
         <li>
          <code>
           0 &lt;= A.length &lt;= 20000
          </code>
         </li>
         <li>
          <code>
           0 &lt;= B.length &lt;= 20000
          </code>
         </li>
         <li>
          <code>
           A
          </code>
          and&nbsp;
          <code>
           B
          </code>
          consist only of lowercase letters.
         </li>
        </ol>
       </div>
      </div>
     </div>
    </div>
   </div>
  </div>
  <div>
   <h1 class="question_title">
    889. 亲密字符串
   </h1>
   <p>
    给定两个由小写字母构成的字符串&nbsp;
    <code>
     A
    </code>
    &nbsp;和&nbsp;
    <code>
     B
    </code>
    &nbsp;，只要我们可以通过交换
    <code>
     A
    </code>
    中的两个字母得到与
    <code>
     B
    </code>
    相等的结果，就返回&nbsp;
    <code>
     true
    </code>
    &nbsp;；否则返回
    <code>
     false
    </code>
    。
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     示例 1：
    </strong>
   </p>
   <pre><strong>输入： </strong>A = "ab", B = "ba"
<strong>输出： </strong>true
</pre>
   <p>
    <strong>
     示例 2：
    </strong>
   </p>
   <pre><strong>输入： </strong>A = "ab", B = "ab"
<strong>输出： </strong>false
</pre>
   <p>
    <strong>
     示例 3:
    </strong>
   </p>
   <pre><strong>输入： </strong>A = "aa", B = "aa"
<strong>输出： </strong>true
</pre>
   <p>
    <strong>
     示例 4：
    </strong>
   </p>
   <pre><strong>输入： </strong>A = "aaaaaaabc", B = "aaaaaaacb"
<strong>输出： </strong>true
</pre>
   <p>
    <strong>
     示例 5：
    </strong>
   </p>
   <pre><strong>输入： </strong>A = "", B = "aa"
<strong>输出： </strong>false
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     提示：
    </strong>
   </p>
   <ol>
    <li>
     <code>
      0 &lt;= A.length &lt;= 20000
     </code>
    </li>
    <li>
     <code>
      0 &lt;= B.length &lt;= 20000
     </code>
    </li>
    <li>
     <code>
      A
     </code>
     &nbsp;和&nbsp;
     <code>
      B
     </code>
     &nbsp;仅由小写字母构成。
    </li>
   </ol>
  </div>
 </body>
</html>